﻿using System.Collections.Generic;
using LinqToLfsWorld.Interface;
using System;
using System.Runtime.Serialization;

namespace LinqToLfsWorld
{

	/// <summary>
	/// A Live For Speed host. Note that there are no server queryable properties for the host.
	/// </summary>
	[Serializable]
	[DataContract]
	public class Host : ILfsWorldEntity
	{
		/// <summary>
		/// Gets or sets the name of the host.
		/// </summary>
		[DataMember]
		public string HostName { get; set; }

		/// <summary>
		/// Gets or sets the type of the host.
		/// </summary>
		[DataMember]
		public HostType Type { get; set; }

		/// <summary>
		/// Gets the host version string.
		/// </summary>
		[DataMember]
		public string Version { get; set; }

		/// <summary>
		/// Gets or sets the Test Id.
		/// </summary>
		[DataMember]
		public byte TestId { get; set; }

		/// <summary>
		/// 3-digit track identifier
		/// </summary>
		[DataMember]
		public string TrackIdent { get; set; }

		/// <summary>
		/// Gets the full track name from the <see cref="TrackIdent">TrackIdent</see>
		/// </summary>
		[DataMember]
		public string TrackName { get; internal set; }

		/// <summary>
		/// Gets or sets the max players.
		/// </summary>
		[DataMember]
		public byte MaxPlayers { get; set; }

		/// <summary>
		/// Gets or sets the car flags. See the <see cref="LinqToLfsWorld.CarFlags">CarFlags</see> enumeration.
		/// </summary>
		[DataMember]
		public CarFlags CarFlags { get; set; }

		/// <summary>
		/// Gets or sets the host rule flags. See the <see cref="LinqToLfsWorld.RuleFlags">RuleFlags</see> enumeration.
		/// </summary>
		[DataMember]
		public RuleFlags RuleFlags { get; set; }

		/// <summary>
		/// Gets or sets the qualifying minutes.
		/// </summary>
		[DataMember]
		public byte QualifyingMinutes { get; set; }

		/// <summary>
		/// Gets or sets the country.
		/// </summary>
		/// <value>The country.</value>
		[DataMember]
		public string Country { get; set; }

		/// <summary>
		/// Gets or sets the current number of online racers.
		/// </summary>
		/// <value>The racer count.</value>
		[DataMember]
		public byte RacerCount { get; set; }


		/// <summary>
		/// Gets or sets the online racer names.
		/// </summary>
		/// <value>The racer names.</value>
		[DataMember]
		public string [] RacerNames { get; set; }

		/// <summary>
		/// Gets or sets the session mode. See the <see cref="LinqToLfsWorld.HostSessionMode">HostSessionMode</see> enumeration.
		/// </summary>
		/// <value>The session mode.</value>
		[DataMember]
		public HostSessionMode SessionMode { get; set; }

		/// <summary>
		/// Gets or sets the laps.
		/// </summary>
		/// <value>The laps.</value>
		[DataMember]
		public byte Laps { get; set; }

		/// <summary>
		/// Gets or sets the hours.
		/// </summary>
		/// <value>The hours.</value>
		[DataMember]
		public byte Hours { get; set; }

	}
}
